package com.jollychic.www.roomdatebasedemo.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;

import com.jollychic.www.roomdatebasedemo.model.GoodEntity;
import com.jollychic.www.roomdatebasedemo.model.result.InnerResultGoodsModel;

import java.util.List;

/**
 * desc: 商品dao <br/>
 * author: 李超杰 <br/>
 * date: 2018/5/7 下午9:15 <br/>
 * since v <br/>
 */
@Dao
public interface IGoodsDao {

    @Query("Select * from Goods")
    List<GoodEntity> queryGoodsList();

    @Query("select store_id,goodId,storeName from Stores inner join Goods on Stores.storeId = Goods.store_id")
    List<InnerResultGoodsModel> queryMul();

    @Insert
    void insertGoods(GoodEntity... goodEntities);

    @Insert
    void insertGoods(List<GoodEntity> goodEntityList);

    @Delete
    void deleteGoods(List<GoodEntity> goodEntities);
}
